//------------------------------------------------------------------------------------------------------
// 入口
//------------------------------------------------------------------------------------------------------
// 新建全局变量Game，可用自定义子类继承GameBase
var Game = new GameBase();
// 监听引擎初始化
EventUtils.addEventListenerFunction(ClientWorld, ClientWorld.EVENT_INITED, () => {
    // to do
    // -- 如显示1号界面

    var strength = 1;

    Game.player.data.W26_lockaidGunCount = 5;
    Game.player.data.W26_lockSkill = 5;
    var PLUGIN_GUI_lock: number = 15001;




    var ff = (s) => {
        alert("现在的强度是 " + s.toString());
        var guiLock = GameUI.show(PLUGIN_GUI_lock) as W26_GUI_lock;
        guiLock.setStrength(s);
        guiLock.start();

        guiLock.once(W26_GUI_lock.COMPLETED, this, (res: boolean) => {
            if (res) {
                //过关 牛逼
                strength += 5;
                Game.player.data.W26_lockSkill += 4;
                Game.player.data.W26_lockaidGunCount += 1;
                alert("过关了牛逼，现在的强度是 " + strength.toString());
            }
            else {
                alert("你失败了！重开")
                strength = 1;
                Game.player.data.W26_lockSkill = 1;
                Game.player.data.W26_lockaidGunCount = 5;
            }
            Callback.New(ff, this, [strength]).delayRun(1000);
            //ff(strength);
        });

    }

    ff(strength);




}, null)